import { computed } from 'vue';

export function useTableListMarginStyle(foldCardRef) {
  const tableListMarginStyle = computed(() => {
    if (!foldCardRef.value) return { display: 'none' };
    if (foldCardRef.value.isFold) return { marginLeft: 'var(--ycy-gap-base)' };
    return { marginLeft: `calc(${foldCardRef.value.width} + var(--ycy-gap-base) * 2)` };
  });

  return tableListMarginStyle;
}